<%@page import="cn.jhc.bean.UserBean"%>
<%@page import="cn.jhc.dao.ActivitiesDAO"%>
<%@page import="cn.jhc.dao.NewMsgDAO"%>
<%@page import="cn.jhc.dao.MusicDAO"%>
<%@page import="cn.jhc.dao.ActDAO"%>
<%@page import="cn.jhc.bean.MsgBean"%>
<%@page import="cn.jhc.dao.MsgDao"%>
<%@page import="java.util.ArrayList"%>
<%@page import="cn.jhc.bean.NewsBean"%>
<%@page import="java.util.List"%>
<%@page import="cn.jhc.dao.ConnectionFactory"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	UserBean user = (UserBean)session.getAttribute("user");
	if(null ==user){
		String getb=(String)request.getParameter("getb");
		RequestDispatcher dispatcher = request.getRequestDispatcher("/login.jsp");
		dispatcher.forward(request, response);
		return;
	}
%>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="./css/news.css"></link>
<script type="text/javascript">
	function MM_popupMsg(msg) {

		alert(msg);

	}
</script>
<title>校园新闻</title>
</head>
<body>
	<div id="wrapper">
		<jsp:include page="./header.jsp"></jsp:include>
		<div id="address">
			<a>当前位置： 活动信息</a>
		</div>
		<%
			String id = request.getParameter("act_id");
			int Act_id = Integer.parseInt(id);
		%>
		<div id="wrapperdown">
			<div id="topright">
				<div id="righttop">
					<a>讨论区最新主题</a>
				</div>
				<div id="right_down">
					<%
						ArrayList<MsgBean> m = new ArrayList<MsgBean>();
						MsgDao water = new MsgDao();
						water.setCon(ConnectionFactory.getConnection());
						m = water.getAllMessages(1, 4);
						request.setAttribute("water", m);
					%>
					<%
						ArrayList<MsgBean> a = new ArrayList<MsgBean>();
						ActDAO act = new ActDAO();
						act.setCon(ConnectionFactory.getConnection());
						a = act.getAllMessages(1, 4);
						request.setAttribute("act", a);
					%>
					<%
						ArrayList<MsgBean> b = new ArrayList<MsgBean>();
						MusicDAO music = new MusicDAO();
						music.setCon(ConnectionFactory.getConnection());
						b = music.getAllMessages(1, 4);
						request.setAttribute("music", b);
					%>
					<%
						ArrayList<MsgBean> n = new ArrayList<MsgBean>();
						NewMsgDAO NewMsg = new NewMsgDAO();
						NewMsg.setCon(ConnectionFactory.getConnection());
						n = NewMsg.getAllMessages(1, 4);
						request.setAttribute("News", n);
					%>
					<table width="280" align="left">
						<c:forEach items="${requestScope.water}" var="water">
							<tr>
								<td height="30"><div id="alltitle">
										<img src="images/face.gif"></img><a
											href="showmessages.jsp?id=${water.id}">[灌水区]${water.title}</a>
									</div></td>
							</tr>
						</c:forEach>
						<c:forEach items="${requestScope.act}" var="act">
							<tr>
								<td height="30"><div id="alltitle">
										<img src="images/face.gif"></img><a
											href="showActmessages.jsp?id=${act.id}">[活动专区]${act.title}</a>
									</div></td>
							</tr>
						</c:forEach>
						<c:forEach items="${requestScope.music}" var="music">
							<tr>
								<td height="30"><div id="alltitle">
										<img src="images/face.gif"></img><a
											href="showMusicmessages.jsp?id=${music.id}">[音乐专区]${music.title}</a>
									</div></td>
							</tr>
						</c:forEach>
						<c:forEach items="${requestScope.News}" var="News">
							<tr>
								<td height="30"><div id="alltitle">
										<img src="images/face.gif"></img><a
											href="showNewsmessages.jsp?id=${News.id}">[新闻讨论区]${News.title}</a>
									</div></td>
							</tr>
						</c:forEach>
					</table>
					<div id="entertaolunqu">
						<a href="alltaolunqu.jsp">点此进入讨论区>></a>
					</div>
				</div>
			</div>
			<div id="newscontext2" align="center">
				<div id="newsaddress" align="left">
					<a>首页>活动信息>活动报名</a>
				</div>
				<form name="goto" action="goto.do" method="post">
					<table>
						<tr height="40">
							<td>学院班级:</td>
							<td><input type="text" name="classname"></td>
							<td><div id="shengming"><a>　请输入所在学院班级</a></div></td>
						</tr>
						<tr height="40">
							<td>宿舍寝室:</td>
							<td><input type="text" name="bedroom"></td>
							<td><div id="shengming"><a>　请输入所在宿舍楼和寝室门号</a></div></td>
						</tr>
						<tr height="40">
							<td>您的姓名：</td>
							<td><input type="text" name="name"></td>
							<td><div id="shengming"><a>　请输入真实姓名</a></div></td>
						</tr>
						<tr height="40">
							<td>联系电话：</td>
							<td><input type="text" name="phone"></td>
							<td><div id="shengming"><a>　请输入您的联系方式</a></div></td>
						</tr>
						<tr height="40">
							<td>联系邮箱：</td>
							<td><input type="text" name="email"></td>
							<td><div id="shengming"><a>　请输入您的邮箱</a></div></td>
						</tr>
						<tr height="40">
							<td><input type="hidden" name="act_id" value="<%=Act_id%>"></td>
							<td><input type="submit" name="action" value="提交信息" onclick="MM_popupMsg('报名成功！')"></td>
							<td></td>
						</tr>
					</table>
				</form>
			</div>
		</div>
		<div id="line2"></div>
		<div id="copyright">
			<a>版权所有:蓝调吉他社 </a><a>| </a>
			<div id="admin">
				<a href="houtai_index.jsp">管理员登录</a>
			</div>
		</div>
	</div>
</body>
</html>